-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Uniswap Positions to be used as collateral on the Markets page #807
Conversation
✅ Deploy Preview for aloe-blend-staging canceled.
|
✅ Deploy Preview for aloe-prime canceled.
|
✅ Deploy Preview for aloe-earn ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
638262e
to
cc21ad1
Compare
const hasNoCollateral = | ||
account.assets.token0Raw === 0 && | ||
account.assets.token1Raw === 0 && | ||
(account.uniswapPositions?.length || 0) === 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could use ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I usually prefer those, but for numbers you requested that I use the ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is only the case when we aren't defaulting to zero
<SquareInputWithMax | ||
size='L' | ||
onChange={(event: React.ChangeEvent<HTMLInputElement>) => { | ||
const output = formatNumberInput(event.target.value); | ||
if (output != null) { | ||
setBorrowAmountStr(output); | ||
} | ||
}} | ||
value={borrowAmountStr} | ||
onMaxClick={() => { | ||
if (eightyPercentMaxBorrowAmountStr) { | ||
setBorrowAmountStr(eightyPercentMaxBorrowAmountStr); | ||
} | ||
}} | ||
maxDisabled={ | ||
eightyPercentMaxBorrowAmountStr === null || eightyPercentMaxBorrowAmountStr === borrowAmountStr | ||
} | ||
maxButtonText='80% Max' | ||
placeholder='0.00' | ||
fullWidth={true} | ||
inputClassName={borrowAmountStr !== '' ? 'active' : ''} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use some UX improvements, we can talk about this offline
I think everything is working. Only annoying thing is that sometimes some dust is left in the BorrowerNFT after you withdraw the Uniswap position.
I'm going to do some work on the contract side to fix that up. Then we'll be able to withdraw everything and give them their ante in a single transaction (right now it requires a refresh and an extra withdraw).edit: fixedAlso, we may want to refactor the
BorrowingWidget
soon. The data structures made sense when we were only dealing with tokens, but after this change portions of it feel a bit hacky.